<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <p>{{msg}}</p>
        <button @click="dd">逆转世界</button>
    </div>
    
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    const add = new Vue({
        el: '#app',
        data: {
            msg: 'Hello World'
        },
        methods: {
            dd(){
                this.msg = this.msg.split('').reverse().join('') //字符串转数组 split() reverse() 倒序 数组转字符串 join() 
            }
           
        }
    })

</script>
</html>